The present invention is related to data storage systems. More particularly, the present invention is directed to a method and mechanism of accessing segments in data storage systems.
Conventional data storage systems include one or more storage devices connected to a controller or manager. As used herein, the term “data storage device” refers to any device or apparatus utilizable for the storage of data, e.g., a disk drive. For explanatory purposes only and not as an intent to limit the scope of the invention, the term “disk drive” as used in this document is synonymous with the term “data storage device.”
Data storage devices typically store data on one or more magnetic discs called platters. To access stored data, the platter on which the data is stored has to be moved into the correct position before the data can be read, i.e., the sector of the platter where the data is located on has to be positioned under a special electromagnetic read/write device called a head, which is mounted onto a slider on an arm that is positioned over the surface of the platter by an actuator. Once the platter is in the correct position, the platter rotates at high speed, driven by a spindle motor connected to the spindle that the platter is mounted on, and the head reads the data on the platter as it flies by.
The time it takes to move the platter into the correct position, i.e., the seek time, is frequently the most expensive part of an I/O (input/output) operation. The seek time can vary anywhere from 5–15 ms (milliseconds). Whereas the time it takes to read the data from the platter once it is in the correct position could be as fast as a couple of milliseconds depending upon the transfer rate of the disk drive, which is a function of the RPM (rotations per minute) of the disk drive, and the amount of data to be read.
Data in data storage systems are usually organized into rows, blocks, extents, segments, and tables. Data are stored in rows. Rows, in turn, are stored in blocks. Each block, also referred to as a page, corresponds to a specific number of bytes of physical space on a data storage device. The size of a block is usually set at a prescribed level when the data storage system is created and will typically be a multiple of the operating system's block size.
Blocks, in turn, are stored in extents. An extent is a contiguous set of blocks on a disk drive. Extents are stored in segments, which are logical containers each holding a set of extents. For various reasons, e.g., load balancing, random access, etc., extents of a segment may not be contiguous on a data storage device, may span multiple files on a data storage device, and may even span multiple data storage devices. Each table comprises one or more segments.
There are two types of data access in data storage systems: random and sequential. An example of random access is access using RowIDs. A RowID is a physical identifier of a row. RowIDs may be stored separately from the table, e.g., in an index. A full table scan is an example of sequential access. In a full table scan, the one or more segments in the table have to be identified and all of the extents in each segment have to be located. I/O operations are then submitted to access each segment. The I/O operations are usually submitted on an extent by extent basis since extents are contiguous blocks on a data storage device and extents in each segment may be striped across multiple data storage devices.
Given that the I/O operations are submitted on an extent by extent basis, performance of full table scans can vary greatly depending upon the number of extents in the segment(s) of each table. Fewer extents mean less I/O operations, which result in less time spent seeking data and more time spent reading data. In order to optimize space utilization, however, extent sizes in data storage systems are usually minimized. Smaller extent sizes generally lead to an increase in the number of extents per segment as more extents will be needed to store the same amount of data.
Accordingly, it is desirable to provide a method and mechanism where the performance of a full table scan is unaffected by the size of the extents in the segment(s) of the table.
The present invention provides a method and mechanism of accessing segments in data storage systems. In one embodiment, a plurality of extents in a segment are coalesced into a plurality of groups based on data storage device location. A single I/O operation is then submitted for each group of extents.
Further details of aspects, objects, and advantages of the invention are described below in the detailed description, drawings, and claims. Both the foregoing general description and the following detailed description are exemplary and explanatory, and are not intended to be limiting as to the scope of the invention.